package com.jyh.runner;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import com.jyh.service.IStudentService;

/**
 * 服务启动执行
 *
 */
@Component
@Order(value=2)
public class MyStartupRunner1 implements CommandLineRunner {

	private static final Logger logger = LoggerFactory.getLogger(MyStartupRunner1.class);

	@Autowired
	private IStudentService stuService;

	@Override
	public void run(String... args) throws Exception {
		logger.info(">>>>>>>>>>>>>>>服务启动执行，执行加载数据等操作 <<<<<<<<<<<<<");
		logger.info("测试这里可以访问数据库：" + stuService.getList().size());
		
		
	} 

}


